<?php

include_once 'Statement.php';
include_once 'StatementCollection.php';
include_once 'CatchClauseCollection.php';

/**
 *  
 */

class TryCatchStatement extends Statement
{
    public function __construct()
    {
        parent::__construct();
        $this->TryStatements = new StatementCollection();
        $this->CatchClauses = new CatchClauseCollection();
    }
    
    public function __set($name, $value)
    {
        parent::__set($name, $value);
        
        if($name == 'CatchClaues')
        {
            $this->set_CatchClauses($value);
        }
        
        if($name == 'TryStatements')
        {
            $this->set_TryStatements($value);
        }
    }

    public function __get($name)
    {
        $ret = parent::__get($name);
        
        if($ret != null)
        {
            return $ret;
        }
        
        if($name == 'CatchClaues')
        {
            return $this->get_CatchClauses();
        }
        
        if($name == 'TryStatements')
        {
            return $this->get_TryStatements();
        }
    }
    
    public function get_CatchClauses()
    {
        return $this->CatchClauses;
    }

    public function set_CatchClauses(CatchClauseCollection $CatchClauses)
    {
        $this->CatchClauses = $CatchClauses;
    }

    public function get_TryStatements()
    {
        return $this->TryStatements;
    }

    public function set_TryStatements(StatementCollection $TryStatements)
    {
        $this->TryStatements = $TryStatements;
    }

    private $CatchClauses;
    private $TryStatements;
}

?>
